﻿@model PagedData<CMSTemplate>

@{
	ViewBag.Title = "Site Skin Index";
}

@using (Html.BeginForm()) {
	@Html.AntiForgeryToken()

	var grid = CarrotWeb.CarrotWebGrid<CMSTemplate>(Model);

	grid.TableAttributes = new { @class = "datatable" };
	grid.THeadAttributes = new { @class = "tablehead" };
	grid.EmptyDataTemplate = @<text><p> <b>No records found.</b> </p></text>;
	grid.ConfigName(Html.NameFor(x => x));

	grid
		.AddColumn(new CarrotGridTemplateColumn<CMSTemplate> {
			HasHeadingText = false,
			FormatTemplate = @<text> @CarrotWeb.ActionImage("SiteSkinEdit", RouteConfig.AdminCtrlr, new { @path = @item.EncodedPath }, "~/assets/admin/images/pencil.png", "Edit", null, null) </text>
		})
		.AddColumn(x => x.Caption, new CarrotGridColumn { Sortable = true })
		.AddColumn(x => x.TemplatePath, new CarrotGridColumn { Sortable = true });

		@grid.Write()
}